Repository navigation
fix(render): align scrollToRowPosition from the row's actual offsetTop - #4930
Open
lukecotter wants to merge 2 commits into
Open
lukecotter wants to merge 2 commits into
lukecotter wants to merge 2 commits into
Conversation
scrollToRowPosition's center/bottom math derived the offset from the current scrollTop, assuming scrollToRow had placed the target at the top of the window. For rows that cannot sit at the top after the fill (e.g. near the end of the list) this misaligned them — measured ~12px off for center. Compute the alignment from the row's actual offsetTop instead, and sync vDomScrollPosTop/Bottom afterwards so the next user scroll does not diff against a stale tracker and jump (guarded for the basic renderer). Adds a Playwright regression test asserting a near-bottom row lands within 6px of top/center/bottom.
lukecotter
marked this pull request as ready for review
October 2, 2026 15:42
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
scrollToRowPositioncomputed the target offset from the estimated row height rather than the row's actual position, sotop/center/bottomalignment drifted on variableheight rows.Fix
Align from the row's actual
offsetTop, now lands within 6px.Test
test/e2e/scroll-to-row-position.spec.ts.Performance
Neutral. 500k rows, K=5, medians: